package com.lczyfz.istep.common.utils.quartz;

import com.lczyfz.istep.modules.sys.entity.ScheduleJob;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by 锋情 on 2016-11-24.
 */
public class QuartzJobFactory implements Job {
    private static final Logger LOGGER = LoggerFactory.getLogger(QuartzJobFactory.class);

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        ScheduleJob scheduleJob = (ScheduleJob) jobExecutionContext.getMergedJobDataMap().get("scheduleJob");

        JobExecutor.invokeMethod(scheduleJob);
    }
}
